<?php

// No direct access
 
defined('_JEXEC') or die('Restricted access'); ?>
<div id="subHeader">
	<div class="login">
		<img alt="Sartu" src="<?php echo JURI::root();?>templates/lingolangtemplate/images/kandadoa.jpg">
		<div><a class="morea" href="index.php?option=com_user&view=login">Sartu zure kontuan</a></div>
	</div>
	<a id="img1" class="atalak gorria" href="index.php?option=com_hizkuntzak&task=whoSpeaks">
		<div class="atalText"><?php echo $this->rsc->menu_who; ?></div>
	</a>
	<a id="img2" class="atalak morea" href="index.php?option=com_hizkuntzak&task=showLangDetails">
		<div class="atalText "><?php echo $this->rsc->menu_first; ?></div>
	</a>
	<a id="img3" class="atalak laranja"href="index.php?option=com_hizkuntzak&task=qas">
		<div class="atalText"><?php echo $this->rsc->menu_qa; ?></div>
	</a>
	<a id="img5" class="atalak current" href="index.php?option=com_hizkuntzak&task=numbers">
		<div class="atalText"><?php echo $this->rsc->menu_numbers; ?></div>
	</a>
	<a id="img4" class="atalak urdina" href="index.php?option=com_hizkuntzak&task=songs">
		<div class="atalText"><?php echo $this->rsc->menu_songs; ?></div>
	</a>
</div>
<div id="left">
	<div id="menu">
		<ul>
		<?php
			$color = 0;
			$text_color = "gorria";
			foreach($this->langs as $la){
				if ($color == 0) {
					$text_color = "gorria";
					$color++;
				}else if($color == 1){
					$text_color = "morea";
					$color++;
				}else if ($color == 2) {
					$text_color = "laranja";
					$color++;
				}else if ($color == 3) {
					$text_color = "urdina";
					$color++;
				}else if ($color == 4) {
					$text_color = "berdea";
					$color = 0;
				}
				if($this->c_lang == 'eu-ES'){

					if ($la->iso_code == $this->lang->iso_code) {
						print("<li class='selected'><a class='$text_color' href='index.php?option=com_hizkuntzak&task=mainMenu&hlang=$la->iso_code'>$la->name_eu</a></li><br/>");# code...
					} else{
						print("<li ><a class='$text_color' href='index.php?option=com_hizkuntzak&task=mainMenu&hlang=$la->iso_code'>$la->name_eu</a></li><br/>");
					}
				}else{
					if ($la->iso_code == $this->lang->iso_code) {
						print("<li class='selected'><a class='$text_color' href='index.php?option=com_hizkuntzak&task=mainMenu&hlang=$la->iso_code'>$la->name_es</a></li><br/>");
					} else{
						print("<li ><a class='$text_color' href='index.php?option=com_hizkuntzak&task=mainMenu&hlang=$la->iso_code'>$la->name_es</a></li><br/>");
					}
				}
			};
		?>
		<?php
		if($this->show){
			?>
			<br/>
			<hr/>
			<br/>
			<a href="index.php?option=com_hizkuntzak&task=adminHizkuntzak" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button">
			<span class="ui-button-text"><?php echo $this->rsc->admin_title; ?></span></a>
		<?php }?>
		</ul>
	</div>
</div>
<div id="content">
	<?php
		if($this->show){
		?>
		<a href="index.php?option=com_hizkuntzak&task=createNumbersLang&hlang=<?php echo($this->lang->iso_code);?>" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button">
		<span class="ui-button-text"><?php echo $this->rsc->edit; ?></span></a>
		<br/>
		<br/>
		<hr/>
	<?php }?>
	<?php 
		if(count($this->numbersLang)==0){
			?>
			<div style="padding: 0pt 0.7em;" class="ui-state-error ui-corner-all"> 
				<p>
					<span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-alert"></span> 
					<strong><?php echo($this->rsc->main_no_words);?></strong>
				</p>
			</div>
		<?php 
		}
		else{
		?>
		<div id="contleft" style="margin-left:-15px;">
				<?php
					$row = 0;
					$count = 0;
					foreach($this->numbersLang as $number){
						$count++;
							
						if($row == 0){
							echo("<div class='nf'>");
						}
						echo("<a href='#n$number->number' id='$number->number' name='n$number->number' class='numberLink'><img width='80' height='80' src='components/com_hizkuntzak/img/icon-$number->number.png' border=0 /></a>");
							
						echo("<input type='hidden' id='n$number->number-s' value='$number->spelling' />");
						echo("<input type='hidden' id='n$number->number-p' value='$number->pronoun' />");
						echo("<input type='hidden' id='n$number->number-v' value='$number->audioPath' />");
									
						if($row == 2 || $count == count($this->numbersLang)){
							echo("</div>");
							if($row == 2) $row = 0;
						}
						else if($row < 2){
							$row++;
						}
					}
				?>
		</div>
		<div id="contright">
			<video width="480" controls="controls" height="360" autoplay="autoplay" poster="<?php echo JURI::root();?>components/com_hizkuntzak/img/no-video.jpg" id="videoWord">
				<source id="srcwebm" src="<?php echo($this->numbersLang[0]->audioPath);?>.webm" type="video/webm" />
				<source id="srcogg" src="<?php echo($this->numbersLang[0]->audioPath);?>.ogg" type="video/ogg" />
				<source id="srcmp4" src="<?php echo($this->numbersLang[0]->audioPath);?>.mp4" type="video/mp4" />
				<object id="srcobj" width="480" height="360" src="<?php echo($this->numbersLang[0]->audioPath);?>.mp4" >
					<embed id="srcemb" width="480" height="360" src="<?php echo($this->numbersLang[0]->audioPath);?>.flv" >
						<?php echo $this->rsc->no_support ?>: <a href="<?php echo($this->numbersLang[0]->audioPath);?>.mp4" id="dfile"><?php echo $this->rsc->file ?></a>
					</embed>
					</object>
			</video>
			<div id="play_button">
				<a href="#" id="button_link" ><img src="<?php echo JURI::root();?>components/com_hizkuntzak/img/play.png" alt="Play"/></a>
			</div>
			<center>
				<p id='spelling'><?php echo($this->numbersLang[0]->spelling);?></p>
				<p id='pronoun'><?php echo($this->numbersLang[0]->pronoun);?></p>
			</center>
		</div>
	<?php
		} 
	?>
</div>
